#include <stdio.h>

/* 写一个函数，传入参数为应付钱数。返回值为买家最少付出的钱的张数 */
int getMoneyNum(int current_money) {
    int count = 0;  // 记录需要的纸币张数


    int hundreds = current_money / 100;
    count = count + hundreds;
    current_money = current_money % 100;


    int fifties = current_money / 50;
    count = count + fifties;
    current_money = current_money % 50;


    int tens = current_money / 10;
    count = count + tens;
    current_money = current_money % 10;


    int fives = current_money / 5;
    count = count + fives;
    current_money = current_money % 5;


    int ones = current_money;
    count = count + ones;

    return count;
}

int main(int argc, const char* argv[]) {
    int inputmoney = 0;
    printf("请输入需要支付的金额：\n");
    scanf("%d", &inputmoney);

    int result = getMoneyNum(inputmoney);
    printf("你最少需要支付 %d 张人民币\n", result);

    return 0;
}
